<layout name="layout" />

<script src="{$uri}Public/Scripts/PSI/Customer/CustomerField.js?dt={$dtFlag}" type="text/javascript"></script>

<script src="{$uri}Public/Scripts/PSI/SaleContract/SCMainForm.js?dt={$dtFlag}" type="text/javascript"></script>
<!-- GoodsPrice会mix到SCEditForm，所以需要放在其前面引用 -->
<script src="{$uri}Public/Scripts/PSI/Mix/GoodsPrice.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/SaleContract/SCEditForm.js?dt={$dtFlag}" type="text/javascript"></script>

<!-- 生成销售订单用 -->
<script src="{$uri}Public/Scripts/PSI/SaleOrder/SOEditForm.js?dt={$dtFlag}" type="text/javascript"></script>

<script src="{$uri}Public/Scripts/PSI/UX/CellEditing.js?dt={$dtFlag}" type="text/javascript"></script>

<script src="{$uri}Public/Scripts/PSI/User/UserField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/User/OrgWithDataOrgField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Goods/GoodsWithSalePriceField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Goods/GoodsEditForm.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Goods/GoodsCategoryField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Goods/GoodsBrandField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Goods/GoodsField.js?dt={$dtFlag}" type="text/javascript"></script>


<script src="{$uri}Public/Scripts/PSI/Customer/CustomerEditForm.js?dt={$dtFlag}" type="text/javascript"></script>

<!-- CustomerEditForm.js中用到了WarehouseField.js -->
<script src="{$uri}Public/Scripts/PSI/Warehouse/WarehouseField.js?dt={$dtFlag}" type="text/javascript"></script>


<script src="{$uri}Public/Lodop/LodopFuncs.js?dt={$dtFlag}" type="text/javascript"></script>

<script>
  Ext.onReady(function () {
    var app = Ext.create("PSI.App", {
      userName: "{$loginUserName}",
      productionName: "{$productionName}"
    });

    var permission = {
      add: "{$pAdd}",
      edit: "{$pEdit}",
      del: "{$pDelete}",
      genPDF: "{$pGenPDF}",
      commit: "{$pCommit}",
      genSOBill: "{$pGenSOBill}",
      showAddGoodsButton: "{$showAddGoodsButton}",
      print: "{$pPrint}"
    };

    app.add(Ext.create("PSI.SaleContract.SCMainForm", {
      permission: permission
    }));

    app.setAppHeader({
      title: "{$title}"
    });
  });
</script>
